/*
 * UISwitchListener.java
 * 
 * last update: 14.01.2010 by Stefan Saru
 * 
 * author:	Felix(felix@ulise.cs.pub.ro)
 *
 * Obs: N/A
 */

package ide;

import java.awt.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;


public class UISwitchListener implements PropertyChangeListener {
	JComponent componentToSwitch;

	public UISwitchListener(JComponent c) {
		vide.spl.showStatus("Creating UISwitchListener..");

		componentToSwitch = c;
	}

	public void propertyChange(PropertyChangeEvent e) {
		String name = e.getPropertyName();
		if (name.equals("lookAndFeel")) {
			SwingUtilities.updateComponentTreeUI(componentToSwitch);
			componentToSwitch.invalidate();
			componentToSwitch.validate();
			componentToSwitch.repaint();
		}
	}
}

